<div class="special-check main equipmentInfo">
  <bid-tabs
    ng-disabled="equipmentInfo.defaultOrgId"
    query-fn="equipmentInfo.paginationQuery"
    query-bean="equipmentInfo.queryData"
    query-param="orgId"></bid-tabs>
  <div class="query-info shadowbox">
    <div class="container-header">
      设备信息
    </div>
    <form class="base-info pa-form-content">
      <div class="pa-form-control pa-form-control-inline">
        <label>设备名称:</label>
        <input type="text"
          ng-model="equipmentInfo.queryData.deviceName">
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label>内部编号:</label>
        <input type="text"
          ng-model="equipmentInfo.queryData.innerNo">
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label>设备等级:</label>
        <select id="type" name="type"
          ng-model="equipmentInfo.queryData.deviceLevel">
          <option value=""></option>
          <option value="1">一般设备</option>
          <option value="2">主要设备</option>
          <option value="3">关键设备</option>
          <option value="4">特种设备</option>
        </select>
      </div>
    </form>
    <div class="btn-outer-right">
      <a class="pa-btn"
        ng-click="equipmentInfo.query();">
        <i class="fa fa-search"></i>
        <span class="ml5">查询</span>
      </a>
      <a class="pa-btn reset-btn"
        ng-click="equipmentInfo.reset();">
        <i class="fa fa-repeat"></i>
        <span class="ml5">重置</span>
      </a>
    </div>
  </div>
  <div class="registration-code">
    <a class="pa-btn"
      authorization-btn="api/deviceinfo/insertDeviceInfo"
      ng-click="$state.go('equipmentInfoNew')">
      新增设备
    </a>
    <a class="pa-btn"
      authorization-btn="api/deviceinfo/updateDeviceInOutRecord"
      ng-click="equipmentInfo.openEquipPatchExitDialog()">
      离场登记
    </a>
    <a class="pa-btn"
    ng-click="equipmentInfo.printQrCode()">
      打印二维码
    </a>
  </div>
  <div class="pa-table-container shadowbox">
    <form class="base-info">
      <table class="pa-table">
        <thead>
          <tr>
            <th>
              <input type="checkbox"
                ng-model="equipmentInfo.toggleAllFlag"
                ng-click="equipmentInfo.toggleAll()"/>全选
            </th>
            <th>设备名称</th>
            <th>内部编号</th>
            <th>设备型号</th>
            <th>设备等级</th>
            <th class="time-sequence">
              <div>进场时间</div>
              <div class="time-sequence-btn">
                <div class="time-sequence-box"
                  ng-click="equipmentInfo.up('approach_time','0')">
                  <i class="fa fa-caret-up"></i>
                </div>
                <div class="time-sequence-box"
                  ng-click="equipmentInfo.up('approach_time','1')">
                  <i class="fa fa-caret-down"></i>
                </div>
              </div>
            </th>
            <th class="time-sequence">
              <div>出场时间</div>
              <div class="time-sequence-btn">
                <div class="time-sequence-box"
                  ng-click="equipmentInfo.up('exit_time','0')">
                  <i class="fa fa-caret-up"></i>
                </div>
                <div class="time-sequence-box"
                  ng-click="equipmentInfo.up('exit_time','1')">
                  <i class="fa fa-caret-down"></i>
                </div>
              </div>
            </th>
            <th>操作员</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="item in equipmentInfo.equipmentItemList">
            <td>
              <input type="checkbox"
                ng-model="item.checked"
                ng-change="equipmentInfo.isChange()"/>
            </td>
            <td>{{item.deviceName}}</td>
            <td>{{item.innerNo}}</td>
            <td>{{item.deviceModel}}</td>
            <td><div>{{item.deviceLevel == '1' ? '一般设备' :
               item.deviceLevel == '2' ? '主要设备' :
               item.deviceLevel == '3' ? '关键设备' :
               item.deviceLevel == '4' ? '特种设备' : ''}}</div></td>
            <td>{{item.approachTime}}</td>
            <td>{{item.exitTime}}</td>
            <td>{{item.operator}}</td>
            <td class="check">
              <div class="del"
                authorization-btn="api/deviceinfo/queryDeviceDetail"
                ng-click="equipmentInfo.goNewPage(item.id)">
                <i class="fa fa-street-view color"></i>
                <span>查看</span>
              </div>
              <div class="del"
                authorization-btn="api/deviceinfo/deleteDeivceInfo"
                ng-click="equipmentInfo.delete(item.id)">
                <i class="fa fa-trash color"></i>
                <span>
                  删除
                </span>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </form>
    <div class="total-num">
      共计<span class="total-num-colorful">{{equipmentInfo.paginationData.total}}</span>条
    </div>
    <!-- 分页 -->
    <div class="pagination-outer">
      <uib-pagination
        total-items="equipmentInfo.paginationData.total"
        ng-model="equipmentInfo.paginationData.pageNum"
        items-per-page="equipmentInfo.paginationData.pageSize"
        ng-change="pageChange()"
        class="pagination-sm"
        boundary-link-numbers="true"
        max-size="5"
        next-text="下一页"
        previous-text="上一页"></uib-pagination>
    </div>
  </div>

  <script type="text/ng-template" id="equipPatchExitDialog">
    <div class="item-detail-dialog">
      <div class="item-detail-dialog-header">
        <div class="title-txt">
          <span>设备批量出场</span>
        </div>
      </div>
      <div class="item-detail-dialog-content">
        <div desc="autofocus-input">
          <input type="text" autofocus="true"
            style="opacity: 0;width: 0; height: 0;" />
        </div>
        <div class="row-item">
          <form name="addExitTime" novalidate="" autocomplete="off">
            <div class="fixed-left-label">出场时间：</div>
            <div class="right-value">
              <input name="exitTime" type="text" ng-datepicker
                ng-model="vm.outPlantTime" required/>
            </div>
            <span class="mandatory"
              ng-show="(addExitTime.$submitted || addExitTime.exitTime.$dirty) && addExitTime.exitTime.$error.required">
              必填
            </span>
          </form>
        </div>
      </div>
      <div class="item-detail-dialog-footer">
        <a class="pa-btn" ng-click="vm.submit(addExitTime)">
          <i class="fa fa-save"></i>
          <span class="ml5">确定</span>
        </a>
        <a class="pa-btn" ng-click="closeThisDialog()">
          <i class="fa fa-times"></i>
          <span class="ml5">取消</span>
        </a>
      </div>
    </div>
  </script>

  <script type="text/ng-template" id="equipInfoQrCodePrintDialog">
    <div class="item-detail-dialog">
      <div class="item-detail-dialog-header">
        <div class="title-txt">
          <span>设备信息二维码</span>
        </div>
      </div>
      <div class="item-detail-dialog-content">
        <div class="qr-print-scroll-outer">
          <div class="qr-print" style="width: 320px; margin: auto;">
            <div class="qr-item"
              style="width: 100%;height: 184px;padding: 10px; overflow: hidden; word-wrap: break-word;"
              ng-repeat="item in selectedEquipList">
               <div style="color: #000;font-size: 22px;text-align: center;">锡通过江通道公路接线工程</div>
                <div style="overflow: hidden;">
                  <img ng-src="{{vm.getQrCodeSrc(item)}}" style="float: left;width: 130px;">
                  <div style="margin-left: 130px;padding: 15px 10px 10px;color: #000;">
                    <div style="font-size: 26px;font-weight: 800;line-height: 1.3;">{{item.deviceName}}</div>
                    <div style="font-weight: 600;">型号: {{item.deviceModel}}</div>
                    <div style="font-weight: 600;">类型:
                    {{item.deviceLevel == '1' ? '一般设备' :
                     item.deviceLevel == '2' ? '主要设备' :
                     item.deviceLevel == '3' ? '设备' :
                     item.deviceLevel == '4' ? '特种设备' : ''}}</div>
                  </div>
                </div>
                <!-- <div
                  style="text-align: right;padding: 0 15px;color: #000;font-weight: 600;margin-top: -10px;">{{item.constructionTeamName}}</div> -->
           </div>
          </div>


        </div>
      </div>
      <div class="item-detail-dialog-footer" style="text-align:center;">
        <a class="pa-btn" ng-click="vm.print()">
          <i class="fa fa-save"></i>
          <span>打印</span>
        </a>
        <a class="pa-btn" ng-click="closeThisDialog()">
          <i class="fa fa-times"></i>
          <span>取消</span>
        </a>
      </div>
    </div>
  </script>
</div>